package com.java.second_goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.java.second_goods.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 用户Mapper接口
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 根据手机号查询用户
     *
     * @param phone 手机号
     * @return 用户对象
     */
    User selectUserByPhone(@Param("phone") String phone);

    /**
     * 更新用户积分
     *
     * @param userId 用户ID
     * @param points 积分
     * @return 结果
     */
    int updateUserPoints(@Param("userId") Integer userId, @Param("points") Integer points);
}